package com.wzk.travelspringboot.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wzk.travelspringboot.entity.User;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;

/**
 * @Author: WangZiKang
 * @Date: 2025/1/4 22:07
 */
public interface UserDAO extends BaseMapper<User> {

    //根据用户昵称查询用户
    User queryUserByNickName(@Param("nickName") String nickName);

    //根据手机号查询是否已经被使用
    int queryUserCountByPhone(@Param("phone") String phone);

    //验证邮箱是否被使用
    int queryUserCountByEmail(@Param("email") String email);

    String queryNickNameById(long userId);

    //修改用户头像
    int changeUserAvatarById(@Param("userId") long userId,@Param("avatarUrl") String avatarUrl);

    //修改密码
    int changeUserPwdById(@Param("userId") long userId,@Param("password") String password);

    int userCount();

    int userCountOfMonth(@Param("year") int year, @Param("month") int month);

}
